using System;
using System.IO;
using System.Reflection;
using System.Text.RegularExpressions;

using Gtk;

namespace Gazebo.Core.Highlighters
{
    public class TellHighlighter : BasicHighlighter
    {
        private static readonly Regex regex = new Regex("^[^ ]+ tells you: ");
        
        public TellHighlighter() : base(regex, "highlight-tell")
        {
            Tag.ForegroundGdk = new Gdk.Color(255, 255, 0);
        }
        
        public override bool IsHighlighted (string chunk)
        {
            bool tell = base.IsHighlighted(chunk);
            
            if (tell) {
                SoundManager.PlaySound(Assembly.GetExecutingAssembly().GetManifestResourceStream("receive.wav"));
            }
            
            return tell;
        }
    }
}
